package com.nami.store.biz.group.service;

import com.nami.store.api.response.group.GroupDTO;
import com.nami.store.biz.group.convert.GroupConvert;
import com.nami.store.biz.group.repository.GroupRepository;
import com.nami.store.domain.GroupDO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Slf4j
@Service
@RequiredArgsConstructor
public class GrpDomainServiceImpl implements GrpDomainService {

    private final GroupRepository grpRepository;

    @Override
    public GroupDTO getGrpInfoById(String groupId) {
        GroupDO info = grpRepository.getGroup(groupId);
        return GroupConvert.INSTANCE.convert(info);
    }

    @Override
    public GroupDTO getGrpInfo(String appId, String grpId) {
        GroupDO info = grpRepository.getGrpInfo(appId, grpId);
        return GroupConvert.INSTANCE.convert(info);
    }
}
